package net.bwie.realtime.jtp.dws.log.function;

import net.bwie.realtime.jtp.dws.log.been.PageViewBean;
import org.apache.flink.api.common.functions.ReduceFunction;

public class PageViewReduceFunction implements ReduceFunction<PageViewBean> {
    @Override
    public PageViewBean reduce(PageViewBean value1, PageViewBean value2) throws Exception {
        value1.setSessionCount(value1.getSessionCount() + value2.getSessionCount());
        value1.setPvCount(value1.getPvCount() + value2.getPvCount());
        value1.setPvDuringTime(value1.getPvDuringTime() + value2.getPvDuringTime());
        value1.setUvCount(value1.getUvCount() + value2.getUvCount());
        return value1;
    }
}
